package com.three.usermanagement.feign;

import com.three.core.entity.Menu;
import com.three.core.vo.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class MenuFeignFactory implements FallbackFactory<OpenFeignClient> {

    @Override
    public OpenFeignClient create(Throwable cause) {
        return new OpenFeignClient() {
            @Override
            public R<List<Menu>> selectLeftMenuAsync() {
                return new R<List<Menu>>(500,"服务器故障",null);
            }
        };
    }
}
